/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tools;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author ayle
 */
public class Configuration {

    Properties properties = null;
    public final static String PATH_BACKGROUND_IMAGE = "background_image";

    private Configuration() {
        this.properties = new Properties();
        try {
            FileInputStream in = new FileInputStream(Helper.getConfigPath() + "project.properties");
            this.properties.load(in);
            in.close();
        } catch (IOException ex) {
            System.err.println(".::. ERROR .::. project.properties not found!");
            System.exit(-1);
        }
    }

    public static Configuration getInstance() {
        return ConfigurationHolder.INSTANCE;
    }

    public String getProperty(String key) {
        return this.properties.getProperty(key);
    }

    private static class ConfigurationHolder {

        private static final Configuration INSTANCE = new Configuration();
    }
}
